package com.cc.bill.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cc.bill.dao.SubmitBillDao;
import com.cc.bill.entity.SubmitBillEntity;
import com.cc.bill.service.SubmitBillService;
import com.cc.bill.vo.SubmitBillVo;
import com.cc.user.entity.UserEntity;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


@Service("submitBillService")
public class SubmitBillServiceImpl extends ServiceImpl<SubmitBillDao, SubmitBillEntity> implements SubmitBillService {


    @Override
    public List<SubmitBillVo> getSubmitBillByTime(Long uid, Date startTime, Date stopTime, Integer billStatus) {
        SubmitBillDao baseMapper = this.baseMapper;
        return baseMapper.getSubmitBillByTime(uid,startTime,stopTime,billStatus);
    }

    @Override
    public Long insertSubmitBill(SubmitBillEntity submitBillEntity) {
        SubmitBillDao baseMapper = this.baseMapper;
        baseMapper.insert(submitBillEntity);

        return submitBillEntity.getId();
    }

    @Override
    public UserEntity getUserByUid(Long uid) {
        UserEntity user = this.baseMapper.getUserByUid(uid);
        return user;
    }

    @Override
    public List<SubmitBillEntity> getBillList(int billStatus, String startTime, String stopTime) {
        List<SubmitBillEntity> billList = this.baseMapper.getBillList(billStatus, startTime, stopTime);
        return billList;
    }

}